<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>出货单信息  - 仓库管理</title>
	<script type='text/javascript' src="<%=basePath %>/jquery/jquery-1.4.2.js"></script>
	<script type="text/javascript" src="<%=basePath%>/comm/js/map.js"></script>
	
	<link href="<%=basePath %>/background/css/layout.css" rel="stylesheet" type="text/css" />
    <link href="<%=basePath %>/background/css/header.css" rel="stylesheet" type="text/css" />
    <link href="<%=basePath %>/warehouse/css/button.css" rel="stylesheet" type="text/css" />
  </head>
 
  <body>
  
  
  
   <div id="container">
  <div id="header">
		 <jsp:include page="/background/head.jsp"></jsp:include>
	</div>
  <div id="applicationbar">
		 <jsp:include page="/background/app/appbar.jsp"></jsp:include>
	</div>
  <div id="mainContent">
    <div id="sidebar">

		<jsp:include page="/background/left.jsp"></jsp:include>
	</div>
	
	
	
    <div id="content" >
    <div style="border:1px solid #ffffff; border-top-color:#6cb1f1; background-color: #e5f3ff; width: 100%; top: 0px;" >
							<a href="<%=basePath %>warehouse/managereceiptlist_warehouse.action">出仓管理</a> - 出货单信息
     			<input type="button" value="查看谁有权限" class="small button orange"
     				onclick="javascript:openUrlForDialog('selectoperatorlimitedAction_background.action?limitedCode=<s:property value="limitedcode"/>')"/>
     			
	</div>
	
	<table  style="width: 100%;">
    	 <tr>
     		<td>
     	
     	</td>
     		</tr>
 <tr>
     		<td>
				
     <table style="width: 100%;">
    	 <tr>
     		<td width="100%">
     	
     	</td>
     		</tr>
 		<tr>
     		<td>
     			<font color="red" size="20"><s:property value="operationResult"/></font>
     			<s:fielderror id="errormessage" />
     			<br/>
     			
				<table  style= "border:1px solid #ffffff;width: 950px;" class="bottomline">
					<tr> 
					
						<td width="100">出货单号:</td>
						<td>
						<s:if test="receiptlist.state_receiptlist == 9"> 
							<s><s:property value="receiptlist.id_receiptlist"/> </s>
						</s:if>
						<s:else>
							<s:property value="receiptlist.id_receiptlist"/> 
						</s:else>
						
						
						
						<a href="preaddaftersaleservice_warehouse.action?receiptlistid=<s:property value="receiptlist.id_receiptlist"/>">生成售后信息</a>
						<FONT color="green"><s:property value="lastSalesDate"/></FONT>
						<a href="preaddbackreceiptlist_warehouse.action?receiptlistid=<s:property value="receiptlist.id_receiptlist"/>">需要退货</a>
						</td>
						<td ></td>
					</tr> 
					<tr>
					
						<td width="100">出货单部门:</td>
						<td ><s:property value="receiptlist.department_receiptlist"/></td>
						<td ></td>
					</tr>
					
					<tr>
					
						<td>客户ID:</td>
						<td><s:property value="receiptlist.customerid_receiptlist"/></td>
						<td></td>
					</tr>
					
				</table>
				
				<table  style= "border:1px solid #ffffff;" class="bottomline">
					
					
				<tr>
					
						<td width="100">客户信息:</td>
						<td><s:property value="receiptlist.customerinfo_receiptlist"/></td>
						<td></td>
				</tr>
					
				</table>
				
				<table  style= "border:1px solid #ffffff; border-bottom-color:#21a4dc;
    border-left-color:#21a4dc;border-right-color:#21a4dc;border-top-color:#21a4dc;width: 100%;">
				
					<tr>
						<td width="105">出货ID</td>
						<td width="62">图片</td>
						<td width="243">名称</td>
						<td>数量</td>
						<td>单价</td>
						<td>总价</td>
						<td>仓库</td>
					</tr>
					
				<s:iterator id="receiptList" value="receiptList">
					<tr>
					
						<td width="105">
						 	<s:property value="#receiptList.id_receipt"/>
						</td>
						
						<td >
							<img alt="" src="<s:property value="#receiptList.image_receipt"/>" width="60" height="60"/>
						 	
						</td>
						<td>
							<a href="#"><s:property value="#receiptList.goodsname_receipt"/></a>
						</td>
						<td>
							<s:if test="#receiptList.number_receipt > 1">
								<font color="red"><s:property value="#receiptList.number_receipt"/></font>
							</s:if>
							<s:else>
								<s:property value="#receiptList.number_receipt"/>
							</s:else>
							
							
						</td>
						<td>
							<s:property value="#receiptList.price_receipt"/>
						</td>
						<td>
							<s:property value="#receiptList.total_receipt"/>
						</td>
						<td>
							<s:property value="#receiptList.warehousename_receipt"/>
						</td>
					</tr>
				</s:iterator>
				
				</table>
				
				<table style= "border:1px solid #ffffff;width: 100%;" >
					<tr>
					
						<td width="105">运费:</td>
						<td><s:property value="receiptlist.shipprice_receiptlist"/></td>
						<td></td>
					</tr>
					
					<tr>

						<td width="105">快递单号:</td>
						<td>
						<input type="text" value="<s:property value="receiptlist.shipno_receiptlist"/>" id="shipno" name="shipno">
						<input class="small button green" style="bottom: 2px" type="button" onclick="javascript:changeShipNo('<s:property value="receiptlist.id_receiptlist"/>',$('#shipno').attr('value'))" value="修改快递单号" />
						
						</td> 
						<td></td>
					</tr>
					
					<tr>
					
						<td>产品数量:</td>
						<td><s:property value="receiptlist.goodsnumber_receiptlist"/></td>
						<td></td>
					</tr>
					
					<tr>
					
						<td>总额:</td>
						<td><s:property value="receiptlist.total_receiptlist"/></td>
						<td></td>
					</tr>
					
					<tr>
					
						<td>操作员:</td>
						<td><s:property value="receiptlist.username_receiptlist"/></td>                          
						<td></td>
					</tr>
					
					
					<tr>
						<td>描述/备注:</td>
						<td><s:property value="receiptlist.remark_receiptlist"/>
						<a href="premodifyreceiptlist_warehouse.action?id=<s:property value="receiptlist.id_receiptlist"/>">修改备注</a>
						</td>
						<td></td>
					</tr>
					
					<tr>
						<td>日期:</td>
						<td><s:property value="receiptlist.date_receiptlist"/></td>
						<td></td>
					</tr>
					
					

				</table>
			

	</td>
     		</tr>
     		 <tr>
     		<td>
     			<a href="warehouse/preaddreceiptlist_warehouse.action">继续新建出仓单</a> 
     			
     			
     			<s:if test="receiptlist.state_receiptlist == 0">
     			<button onclick="openUrlForDialog('<%=basePath %>flow/enterflow.action?kind=FLOW.WAREHOUSE.RECEIPTLIST&kindid=<s:property value="receiptlist.id_receiptlist"/>','son','DialogWidth:800px;DialogHeight:600px;')">
						查看流程
					</button>
     			</s:if>
     			
     	</td>
     	</tr>
     	
     	
     	
     	</table>
     	
	</td>
     		</tr>
     		 <tr>
     		<td>
     		<table  style= "border:1px solid #ffffff; border-top-color:#6cb1f1;background-color:#e5f3ff;width: 100%; ">
     		
     		<tr>
     			<td>售后信息</td>
     		</tr>
     	</table>
     	
     	
     	
     	
     	
     <table style= "width:100%;">
		<s:iterator id="aftersaleserviceList" value="aftersaleserviceList">
				<tr>

					<td>
					
						<table  style= "border:1px solid #ffffff; border-bottom-color:#b2d5ff;width:100%;
    border-left-color:#b2d5ff;border-right-color:#b2d5ff;border-top-color:#b2d5ff">
									<tr>
										<td>
											<table style= "background-color:#f3f7fc;width:100%;">
												<tr>
													<td>
														售后:<a href="infoaftersaleservice_warehouse.action?id=<s:property value="#aftersaleserviceList.id_aftersaleservice"/>"><s:property value="#aftersaleserviceList.id_aftersaleservice"/></a>
													    	出仓:
															<s:if test="#aftersaleserviceList.receiptlistid_aftersaleservice == 0">
					
																无出仓号
															</s:if>
															<s:else>
																<a href="receiptlistinfo_warehouse.action?id=<s:property value="#aftersaleserviceList.receiptlistid_aftersaleservice"/>">
																	<s:property value="#aftersaleserviceList.receiptlistid_aftersaleservice"/>
																</a>
															</s:else>
													
													<td>
													
													</td>
													<td align="right">
														时间:<s:property value="#aftersaleserviceList.date_aftersaleservice"/>
													</td>
													
												 	
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<td>
											<table style="border-collapse:collapse; border-width:1px 0 0 1px;background-color: #f5f5f5;width:100%;">
												<tr>
													<td width="435" >

														<table >
															<tr>
																<td width="105">
																 	
																
																</td>
																<td width="305">
																<a href="#">
																产品信息:<s:property value="#aftersaleserviceList.goodsinfo_aftersaleservice"/>
																</a>
																</td>
																
																<td width="105" align="center">
																
																
																
															
																</td>
															</tr>
															
															
															<tr>
																<td width="105">
																 	
																
																</td>
																<td width="305">
																<a href="#">
																问题描述:<s:property value="#aftersaleserviceList.problemdescription_aftersaleservice"/>
																</a>
																</td>
																
																<td width="105" align="center">
																
																
																
															
																</td>
															</tr>
															
															
															<tr>
																<td width="105">
																 	
																
																</td>
																<td width="305">
																<a href="#">
																验证问题:<s:property value="#aftersaleserviceList.confirmproblemdescription_aftersaleservice"/>
																</a>
																</td>
																
																<td width="105" align="center">
																
																
																
															
																</td>
															</tr>
														</table>
													</td>
													
													<td align="center" width="185">
														<font color="green">
														<s:property value="#aftersaleserviceList.receiveshipno_aftersaleservice"/>
														</font>
														</br>
														<s:if test="#aftersaleserviceList.shipno_aftersaleservice != null "> 
														<font color="red">
														<s:property value="#aftersaleserviceList.shipno_aftersaleservice"/>
														</font>
														</s:if>
													</td>
													
													<td align="center">
														<s:property value="#aftersaleserviceList.customerid_aftersaleservice"/>
													</td>
													
													<td align="center">
														
														<s:property value="flowRecordlistMap.get(#aftersaleserviceList.id_aftersaleservice).cnname_recordlist"/>
														<br/>
														<button onclick="openUrlForDialog('<%=basePath %>flow/enterflow.action?kind=FLOW.WAREHOUSE.AFTERSALESERVICE&kindid=<s:property value="#aftersaleserviceList.id_aftersaleservice"/>')">
															查看流程
														</button>
													</td>
													
													<td align="center">
													
															
														<s:property value="#aftersaleserviceList.username_aftersaleservice"/>
														
														</br>
														<s:if test="#session.userInfo.user_email == #receiptlistList.useremail_receiptlist">
															<a href="javascript:del('<s:property value="#receiptlistList.customerid_receiptlist"/>',<s:property value="#receiptlistList.id_receiptlist"/>)"> 取消此订单 </a>
														</s:if>
													
													</td>
												</tr>
											</table>
										</td>
									</tr>
									<s:if test="#aftersaleserviceList.remark_aftersaleservice!=''">
									<tr>
										<td bgcolor="fff7d9">
											备注：<s:property value="#aftersaleserviceList.remark_aftersaleservice"/>
										</td> 
									</tr>
									</s:if>
									
									
							</table>
							</td>
					</tr>
					 
			</s:iterator>
			
			<tr>
     		<td>
     		
     		<table style= "border:1px solid #ffffff; border-top-color:#6cb1f1;width: 950px; background-color:#e5f3ff;width:100%; ">
     		
     		<tr>
     			<td>退货信息</td>
     		</tr>
     	</table>
					
						<table style="width:100%;">
			<s:iterator id="backreceiptlistList" value="backreceiptlistList">
				<tr>			
						<td>
							<table  style= "border:1px solid #ffffff; border-bottom-color:#b2d5ff;
    border-left-color:#b2d5ff;border-right-color:#b2d5ff;border-top-color:#b2d5ff;width:100%;">
									<tr>
										<td>
											<table style="width:100%;background-color: #f3f7fc;">
												<tr>
													<td>
													<s:if test="#backreceiptlistList.state_backreceiptlist == 9">
														<s>
															退仓单号:
														</s><a href="infobackreceiptlist_warehouse.action?id=<s:property value="#backreceiptlistList.id_backreceiptlist"/>" title=""><s:property value="#backreceiptlistList.id_backreceiptlist"/></a>
														</s:if>
														<s:else>
															退仓单号:<a href="infobackreceiptlist_warehouse.action?id=<s:property value="#backreceiptlistList.id_backreceiptlist"/>" title=""><s:property value="#backreceiptlistList.id_backreceiptlist"/></a>
														</s:else>
														
														出仓单号：<a href="receiptlistinfo_warehouse.action?id=<s:property value="#backreceiptlistList.receiptlistid_backreceiptlist"/>" title=""><s:property value="#backreceiptlistList.receiptlistid_backreceiptlist"/></a>
													<td>
														
													</td>
													<td align="right">
														退仓时间:<s:property value="#backreceiptlistList.date_backreceiptlist"/>
													</td>
													
												 	
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<td>
											<table  style="border-collapse:collapse; border-width:1px 0 0 1px;width:100%;">
												<tr>
													<td width="515" >
													
													
													
													
													<s:iterator id="purchaseList" value="purchaseListMap.get(#backreceiptlistList.id_backreceiptlist)">
														<table >
															<tr>
																<td width="105">
																 	
																
																</td>
																<td width="305">
																<a href="#">
																<s:property value="#purchaseList.goodsname_purchase"/>
																</a>
																</td>
																
																<td width="105" align="center">
																
																<s:property value="#purchaseList.price_purchase"/></br>
																
																<s:if test="#purchaseList.number_purchase > 1">
																<font color="red">
																
																(<s:property value="#purchaseList.number_purchase"/>件)
																</font>
																</s:if>
																<s:else>
																
																(<s:property value="#purchaseList.number_purchase"/>件)
																
																</s:else>
																</td>
															</tr>
															
														</table>
													</s:iterator>
													
														
													</td>
													
													<td align="center">
														<s:property value="#backreceiptlistList.total_backreceiptlist"/></br>
														<font color="#cococo">(快递:<s:property value="#backreceiptlistList.shipprice_backreceiptlist"/>)</font>
													</td>
													
													<td align="center"> 
														<s:property value="#"/>
													</td>
													
												 
													
													<td align="center">
													
															
														<s:property value="#backreceiptlistList.username_backreceiptlist"/>
														 
														<s:if test="#session.userInfo.user_email == #backreceiptlistList.useremail_backreceiptlist">
															<s:if test="#backreceiptlistList.state_backreceiptlist == 0">
															<a href="javascript:cancelackreceiptlistB('<s:property value="#backreceiptlistList.id_backreceiptlist"/>',<s:property value="#backreceiptlistList.id_backreceiptlist"/>)"> 取消此进仓单 </a>
															</s:if>
														</s:if>
													
													</td>
												</tr>
											</table>
										</td>
									</tr>
									<s:if test="#purchaselistList.remark_purchaselist!=''">
									<tr>
										<td bgcolor="fff7d9">
										<table>
											<tr>
											<td bgcolor="fff7d9">
											备注：<s:property value="#purchaselistList.remark_purchaselist"/>
											
										</td>
										<td align="right"><a href="#"/>修改</a>	</td>
										</tr>
										</table>
										
										</td>
									</tr>
									</s:if>
									
									
							</table>
						
						
						</td>
						
					
						
						
							
					
				</tr>
			</s:iterator>
		</table>
					</td>
					
					
					
						
							
				
				</tr>
		</table>
     	</td>
     	</tr>
     	
     	
     	
     	</table>

	
	</div>
  </div>
  <div id="footer">
<jsp:include page="/background/tail.jsp"></jsp:include>
	</div>
</div>
  
 
  
 
  </body>
  
  <script type="text/javascript">

  $("#shipno").die().live("keydown",function(event){       
      if(event.keyCode==13){      
    	//alert("OK" + evt.keyCode);
    	  changeShipNo('<s:property value="receiptlist.id_receiptlist"/>',$('#shipno').attr('value'));
  		return ;
     }       
	}); 
  
function cancelackreceiptlistB(name,id){
	if(confirm("删除 "+"退仓单号:"+id+" \"" + name + "\" ")){
		window.location.href='cancelbackreceiptlist_warehouse.action?id=' + id;
	}
}

function changeShipNo(receiptlistid,shipno){
	$.getJSON(encodeURI(encodeURI("changeshipno_warehouse.action?receiptlistid="+receiptlistid+"&shipno=" + shipno)), function(data){ 
			if(data.responseText != ""){
				alert(data.responseText);
	  		}
		});
}


</script>
</html>
